package com.zy.design.dd.abs;

import com.zy.design.dd.entity.CountData;
import com.zy.design.dd.entity.DataLine;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhaoyi
 * @date 2021/3/19 13:56
 * 计算
 */
public class Counter {




    private List<CountHandler> countHandlerList = new ArrayList<>();

    public void addHandler(CountHandler countHandler) {
        countHandlerList.add(countHandler);
    }


    public CountData count(DataLine dataLine,CountData countData) {
        for (CountHandler handler : countHandlerList) {
            handler.count(dataLine,countData);
        }
        return countData;
    }


}
